SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwbAlumnos
AS
SELECT  dbo.tb_Alumnos.Documento, dbo.tb_Alumnos.Apellidos, 
               dbo.tb_Alumnos.Nombres, dbo.vwrLocalidades.Descripcion AS Localidad, 
               dbo.tb_Alumnos.Cuise
FROM  dbo.tb_Alumnos INNER JOIN
               dbo.vwrLocalidades ON dbo.tb_Alumnos.Localidad = dbo.vwrLocalidades.ID INNER JOIN
               dbo.vwrSexo ON dbo.tb_Alumnos.Sexo = dbo.vwrSexo.ID INNER JOIN
               dbo.vwrTiposDeDocumento ON dbo.tb_Alumnos.Tipo = dbo.vwrTiposDeDocumento.ID

GO
GRANT SELECT ON  [dbo].[vwbAlumnos] TO [Alumnos]
GRANT SELECT ON  [dbo].[vwbAlumnos] TO [Becas]
GRANT SELECT ON  [dbo].[vwbAlumnos] TO [Coordinaciones]
GRANT SELECT ON  [dbo].[vwbAlumnos] TO [GestionInstitucional]
GRANT SELECT ON  [dbo].[vwbAlumnos] TO [SoloVer]
GO
